import upload from '@/utils/upload';
import { request, requestFy } from '@/utils/request';

// 查询用户个人信息
export function getUserProfile() {
  return request({
    url: '/system/user/profile/get',
    headers: {
      isToken: false
    },
    method: 'GET'
  });
}
// 查询用户权限
export function getUserAuthority(data) {
  return requestFy({
    url: '/user-autor/list-menus-from-applet',
    headers: {
      isToken: false
    },
    data: data,
    method: 'POST'
  });
}

// 修改用户个人信息
export function updateUserProfile(data) {
  return request({
    url: '/system/user/profile/update',
    method: 'PUT',
    data: data
  });
}
// 用户密码重置
export function updateUserPwd(datas) {
  return request({
    url: '/system/user/profile/update-password',
    method: 'PUT',
    data: datas
  });
}
// 用户头像上传
export function uploadAvatar(data) {
  return upload({
    url: '/system/user/profile/update-avatar',
    method: 'PUT',
    name: data.name,
    filePath: data.filePath
  });
}
// 换令牌
export function refreshTokenNew(ref) {
  return request({
    url: '/system/auth/refresh-token?refreshToken=' + ref,
    method: 'POST'
  });
}
// 查询组织开关
export function getBasisDeploy(tenantId) {
  return requestFy({
    url: `/coal-basisDeploy/find-basic-enterId/${tenantId}`,
    method: 'GET'
  });
}
